package com.xtoad.ecms.baseinfo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xtoad.ecms.common.web.base.BaseDTO;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 用户信息通用DTO类
 *
 * @author xtoad
 * @date 2020/05/29
 */
public class UserDTO extends BaseDTO {
    private static final long serialVersionUID = 6809641213115380795L;

    /**
     * 姓名
     */
    @NotNull(message = "用户姓名不能为空")
    private String name;

    /**
     * 登录名
     */
    @NotNull(message = "用户登录名不能为空")
    private String loginNo;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 邮箱
     */
    @Email
    @NotNull(message = "邮箱不能为空")
    private String email;

    /**
     * 电话
     */
    private String phone;

    /**
     * 密码
     */
    private String password;

    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 性别
     */
    private String sex;

    /**
     * 获取 姓名
     */
    public String getName() {
        return this.name;
    }

    /**
     * 设置 姓名
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取 登录名
     */
    public String getLoginNo() {
        return this.loginNo;
    }

    /**
     * 设置 登录名
     */
    public void setLoginNo(String loginNo) {
        this.loginNo = loginNo;
    }

    /**
     * 获取 昵称
     */
    public String getNickName() {
        return this.nickName;
    }

    /**
     * 设置 昵称
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 获取 邮箱
     */
    public String getEmail() {
        return this.email;
    }

    /**
     * 设置 邮箱
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * 获取 电话
     */
    public String getPhone() {
        return this.phone;
    }

    /**
     * 设置 电话
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * 获取 密码
     */
    public String getPassword() {
        return this.password;
    }

    /**
     * 设置 密码
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取 生日
     */
    public Date getBirthday() {
        return this.birthday;
    }

    /**
     * 设置 生日
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    /**
     * 获取 性别
     */
    public String getSex() {
        return this.sex;
    }

    /**
     * 设置 性别
     */
    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "UserDTO{" +
                "name='" + name + '\'' +
                ", loginNo='" + loginNo + '\'' +
                ", nickName='" + nickName + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", password='" + password + '\'' +
                ", birthday=" + birthday +
                ", sex='" + sex + '\'' +
                "} " + super.toString();
    }
}
